class ProductoriginsController < ApplicationController
  # GET /productorigins
  # GET /productorigins.xml
  def index
    @productorigins = Productorigin.all

    respond_to do |format|
      format.html # index.html.erb
      format.xml  { render :xml => @productorigins }
    end
  end

  # GET /productorigins/1
  # GET /productorigins/1.xml
  def show
    @productorigin = Productorigin.find(params[:id])

    respond_to do |format|
      format.html # show.html.erb
      format.xml  { render :xml => @productorigin }
    end
  end

  # GET /productorigins/new
  # GET /productorigins/new.xml
  def new
    @productorigin = Productorigin.new

    respond_to do |format|
      format.html # new.html.erb
      format.xml  { render :xml => @productorigin }
    end
  end

  # GET /productorigins/1/edit
  def edit
    @productorigin = Productorigin.find(params[:id])
  end

  # POST /productorigins
  # POST /productorigins.xml
  def create
    @productorigin = Productorigin.new(params[:productorigin])

    respond_to do |format|
      if @productorigin.save
        flash[:notice] = 'Productorigin was successfully created.'
        format.html { redirect_to(@productorigin) }
        format.xml  { render :xml => @productorigin, :status => :created, :location => @productorigin }
      else
        format.html { render :action => "new" }
        format.xml  { render :xml => @productorigin.errors, :status => :unprocessable_entity }
      end
    end
  end

  # PUT /productorigins/1
  # PUT /productorigins/1.xml
  def update
    @productorigin = Productorigin.find(params[:id])

    respond_to do |format|
      if @productorigin.update_attributes(params[:productorigin])
        flash[:notice] = 'Productorigin was successfully updated.'
        format.html { redirect_to(@productorigin) }
        format.xml  { head :ok }
      else
        format.html { render :action => "edit" }
        format.xml  { render :xml => @productorigin.errors, :status => :unprocessable_entity }
      end
    end
  end

  # DELETE /productorigins/1
  # DELETE /productorigins/1.xml
  def destroy
    @productorigin = Productorigin.find(params[:id])
    @productorigin.destroy

    respond_to do |format|
      format.html { redirect_to(productorigins_url) }
      format.xml  { head :ok }
    end
  end
end
